$db_zugriff->query("INSERT INTO bb".$n."_pms (senderid,recipientid,sendtime,subject,message,icon,disable_smilies,signature)VALUES ('$user_id','$userid','".time()."','$subject','$message','$posticon','$disablesmilies','$signature')");
if($copy) {
$nr = $db_zugriff->insert_id();
$db_zugriff->query("INSERT INTO bb".$n."_pmsend VALUES ('$user_id','$userid','$nr','','".time()."','$subject','$message','$posticon','$disablesmilies','$signature')");
}
if($replyid) $db_zugriff->query("UPDATE bb".$n."_pms SET reply = 1 WHERE pmid = '$replyid'");
if($forwardid) $db_zugriff->query("UPDATE bb".$n."_pms SET forward = 1 WHERE pmid = '$forwardid'");
header("LOCATION: pms.php?box=inbox$session");
}
}
if($action == "reply") {
$pmdata = $db_zugriff->query_first("SELECT * FROM bb".$n."_pms WHERE pmid = '$pmid' AND recipientid = '$user_id'");
$check = $db_zugriff->query_first("SELECT folderid FROM bb".$n."_folders WHERE userid = '$user_id' AND folderid = '$folderid'");
if($check[0]) {
$db_zugriff->query("UPDATE bb".$n."_pms SET folderid = 0 WHERE folderid = '$folderid'");
$db_zugriff->query("DELETE FROM bb".$n."_folders WHERE folderid = '$folderid'");
header("LOCATION: pms.php?box=inbox$session");
exit;
}
exit;
}
if($box == "inbox" && !$pmid) {
$result = $db_zugriff->query("SELECT bb".$n."_pms.*, bb".$n."_user_table.username AS sendername FROM bb".$n."_pms LEFT JOIN bb".$n."_user_table ON (bb".$n."_pms.senderid=bb".$n."_user_table.userid) WHERE recipientid = '$user_id' AND folderid = 0 ORDER BY sendtime DESC");
while ($row = $db_zugriff->fetch_array($result)) {
$result = $db_zugriff->query("SELECT bb".$n."_pmsend.*, bb".$n."_user_table.username FROM bb".$n."_pmsend LEFT JOIN bb".$n."_user_table ON (bb".$n."_pmsend.recipientid=bb".$n."_user_table.userid) WHERE bb".$n."_pmsend.userid = '$user_id' ORDER BY sendtime DESC");
while ($row = $db_zugriff->fetch_array($result)) {